package com.mengzaiwang.book.controller;

import com.mengzaiwang.book.pojo.Book;
import com.mengzaiwang.book.pojo.BookPageDO;
import com.mengzaiwang.book.pojo.BookPageDTO;
import com.mengzaiwang.book.pojo.Result;
import com.mengzaiwang.book.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 猛在王
 * @version 1.0
 * @date 27/6/2024 上午11:12
 * @description User
 * @since 1.0
 */
@RestController
@Slf4j
public class UserController {

    @Autowired
    private UserService userService;
    /**
     * 分页查询
     * @return
     */
    @PostMapping("/book/page")
    public Result<BookPageDO> page(@RequestBody BookPageDTO bookPageDTO) {
        log.info("开启分页查询，参数为：{}",bookPageDTO);
        BookPageDO bookPageDO = userService.page(bookPageDTO);
        return Result.success(bookPageDO);
    }

}
